Commands for all device types LOG SELECT command MODE SELECT(6) command
SCSI-2

8.2.7 LOG SENSE command

The LOG SENSE command (see table 51) provides a means for the initiator to retrieve statistical information maintained by the device about the device or its logical units. It is a complementary command to the LOG SELECT command.

Table 51 - LOG SENSE command

===============================================================================
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=============================================================================|
| 0   |                           Operation code (4Dh)                        |
|-----------------------------------------------------------------------------|
| 1   | Logical unit number      |         Reserved         |  PPC   |    SP  |
|-----------------------------------------------------------------------------|
| 2   |        PC        |        Page code                                   |
|-----------------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----------------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----------------------------------------------------------------------------|
| 5   | (MSB)                                                                 |
|---------                        Parameter pointer                        ---|
| 6   |                                                                 (LSB) |
|-----------------------------------------------------------------------------|
| 7   | (MSB)                                                                 |
|---------                        Allocation length                        ---|
| 8   |                                                                 (LSB) |
|-----------------------------------------------------------------------------|
| 9   |                           Control                                     |
===============================================================================
The parameter pointer control (PPC) bit controls the type of parameters requested from the target:

  1. A PPC bit of one indicates that the target shall return a log page with parameter code values that have changed since the last LOG SELECT or LOG SENSE command. The target shall return only those parameter codes following the parameter pointer field.
  2. A PPC bit of zero indicates that the log parameter requested from the target shall begin with the parameter code specified in the parameter pointer field and return the number of bytes specified by the allocation length field in ascending order of parameter codes from the specified log page. A PPC bit of zero and a parameter pointer field of zero shall cause all available log parameters for the specified log page to be returned to the initiator subject to the specified allocation length.

Saving parameters is an optional function of the LOG SENSE command. If the target does not implement saving log parameters and if the save parameters (SP) bit is one, then the target shall return CHECK CONDITION status, set the sense key to ILLEGAL REQUEST, and set the additional sense code to INVALID FIELD IN CDB.

An SP bit of zero indicates the target shall perform the specified LOG SENSE command and shall not save any log parameters. If saving log parameters is implemented, an SP bit of one indicates that the target shall perform the specified LOG SENSE command and shall save all log parameters identified as savable by the DS bit (8.3.2) to a non-volatile, vendor-specific location.

The page control (PC) field defines the type of parameter values to be selected (see 8.2.6 for the definition of the page control field). The parameter values returned by a LOG SENSE command are determined as follows:

  1. The specified parameter values at the last update (in response to a LOG SELECT or LOG SENSE command or done automatically by the target for cumulative values).
  2. The saved values, if an update has not occurred since the last power- on, hard RESET condition, or BUS DEVICE RESET message and saved parameters are implemented.
  3. The default values, if an update has not occurred since the last power-on, hard RESET condition, or BUS DEVICE RESET message and saved values are not available or not implemented.

The page code field identifies which page of data is being requested (see 8.3.2). If the page code is reserved or not implemented, the target shall terminate the command with CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST with the additional sense code set to INVALID FIELD IN CDB.

The parameter pointer field allows the initiator to request parameter data beginning from a specific parameter code to the maximum allocation length or the maximum parameter code supported by the target, whichever is less. If the value of the parameter pointer field is larger than the largest available parameter code that can be returned by the target on the specified page, the target shall terminate the command with CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST and the additional sense code shall be set to INVALID FIELD IN CDB.

Log parameters within the specified log page shall be transferred in ascending order according to parameter code.